require "Common/define"
require "Logic/Config"
require "Common/functions"

RedDotsRankBattleHandler = {};
local this = RedDotsRankBattleHandler;

function RedDotsRankBattleHandler.init()
    CloseEvent(Config.EventType.RankBattleInfo, this.update);
    ListenEvent(Config.EventType.RankBattleInfo, this.update);
    return this;
end
---排位战开启红点
function RedDotsRankBattleHandler.getFlag()
    local flag = Config.RedDotsFlagState.None;
    if logicMgr.FuncOpenManager.isOpen(Config.FuncOpenType.RankBattle, false) and logicMgr.RankBattleManager.isRankBattleOpen() and logicMgr.RankBattleManager.GetRedDots() then
        flag = Config.RedDotsFlagState.Needful;
    end
    return flag;
end

function RedDotsRankBattleHandler.update()
    RedDotsManager.addBroadcast(Config.RedDotsType.RankBattle);
end